<template>
  <el-form ref="basicInfoForm" :model="info" :rules="rules" label-width="150px" class="dataForm">
    <el-row>
      <el-col :span="12">
        <el-form-item :label="$t('表名称')" prop="tableName">
          <el-input v-model="info.tableName" :placeholder="$t('表名称')" />
        </el-form-item>
      </el-col>
      <el-col :span="12">
        <el-form-item :label="$t('表描述')" prop="tableComment">
          <el-input v-model="info.tableComment" :placeholder="$t('表描述')" />
        </el-form-item>
      </el-col>

      <el-col :span="12">
        <el-form-item :label="$t('实体类名称')" prop="className">
          <el-input v-model="info.className" :placeholder="$t('实体类名称')" />
        </el-form-item>
      </el-col>
      <el-col :span="12">
        <el-form-item :label="$t('作者')" prop="functionAuthor">
          <el-input v-model="info.functionAuthor" :placeholder="$t('作者')" />
        </el-form-item>
      </el-col>
      <el-col :span="24">
        <el-form-item :label="$t('备注')" prop="remark">
          <el-input v-model="info.remark" type="textarea" maxlength="2000" :rows="3" />
        </el-form-item>
      </el-col>
    </el-row>
  </el-form>
</template>
<script>
export default {
  name: 'BasicInfoForm',
  props: {
    info: {
      type: Object,
      default: null
    }
  },
  data() {
    return {
      rules: {
        tableName: [
          { required: true, message: this.$t('必填信息'), trigger: 'blur' }
        ],
        tableComment: [
          { required: true, message: this.$t('必填信息'), trigger: 'blur' }
        ],
        className: [
          { required: true, message: this.$t('必填信息'), trigger: 'blur' }
        ],
        functionAuthor: [
          { required: true, message: this.$t('必填信息'), trigger: 'blur' }
        ]
      }
    }
  }
}
</script>
